package com.liqing.movecomment.vo.model;

public class Result {
    private int code;
    private boolean success;
    private String msg;
    private Object data;

    public static Result success(Object data) {
        return new Result(200, true, "success", data);
    }

    public static Result fail(String msg) {
        return new Result(500, false, msg, null);
    }

    @SuppressWarnings("all")
    public int getCode() {
        return this.code;
    }

    //<editor-fold defaultstate="collapsed" desc="delombok">
    @SuppressWarnings("all")
    public boolean isSuccess() {
        return this.success;
    }
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc="delombok">
    @SuppressWarnings("all")
    public String getMsg() {
        return this.msg;
    }
    //</editor-fold>

    @SuppressWarnings("all")
    public Object getData() {
        return this.data;
    }

    @SuppressWarnings("all")
    public void setCode(final int code) {
        this.code = code;
    }

    //<editor-fold defaultstate="collapsed" desc="delombok">
    @SuppressWarnings("all")
    public void setSuccess(final boolean success) {
        this.success = success;
    }
    //</editor-fold>

    @SuppressWarnings("all")
    public void setMsg(final String msg) {
        this.msg = msg;
    }

    @SuppressWarnings("all")
    public void setData(final Object data) {
        this.data = data;
    }

    //<editor-fold defaultstate="collapsed" desc="delombok">
    @Override
    @SuppressWarnings("all")
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof Result)) return false;
        final Result other = (Result) o;
        if (!other.canEqual((Object) this)) return false;
        if (this.getCode() != other.getCode()) return false;
        if (this.isSuccess() != other.isSuccess()) return false;
        final Object this$msg = this.getMsg();
        final Object other$msg = other.getMsg();
        if (this$msg == null ? other$msg != null : !this$msg.equals(other$msg)) return false;
        final Object this$data = this.getData();
        final Object other$data = other.getData();
        if (this$data == null ? other$data != null : !this$data.equals(other$data)) return false;
        return true;
    }

    @SuppressWarnings("all")
    protected boolean canEqual(final Object other) {
        return other instanceof Result;
    }

    @Override
    @SuppressWarnings("all")
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this.getCode();
        result = result * PRIME + (this.isSuccess() ? 79 : 97);
        final Object $msg = this.getMsg();
        result = result * PRIME + ($msg == null ? 43 : $msg.hashCode());
        final Object $data = this.getData();
        result = result * PRIME + ($data == null ? 43 : $data.hashCode());
        return result;
    }

    @Override
    @SuppressWarnings("all")
    public String toString() {
        return "Result(code=" + this.getCode() + ", success=" + this.isSuccess() + ", msg=" + this.getMsg() + ", data=" + this.getData() + ")";
    }

    @SuppressWarnings("all")
    public Result(final int code, final boolean success, final String msg, final Object data) {
        this.code = code;
        this.success = success;
        this.msg = msg;
        this.data = data;
    }
    //</editor-fold>
}
